home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / dev / lang / pcq12src.lzh / Runtime / Readers / get.asm < prev    next >
Assembly Source File  |  1990-12-10  |  768b  |  35 lines

  1. *
  2. *    Get.asm (of the PCQ Pascal runtime library)
  3. *    Copyright (c) 1989 Patrick Quaid
  4. *
  5. *    This routine is much the same as ReadArb, but just moves
  6. *    the file pointer rather than reading anything.
  7. *
  8. *
  9. *    On entry this routine expects a0 to hold the address of the
  10. *    file record
  11. *
  12.  
  13.     INCLUDE    "/FileRec.i"
  14.  
  15.     SECTION    PCQ_Runtime,CODE
  16.  
  17.     XREF    _p%FillBuffer
  18.     XREF    _p%IOResult
  19.  
  20.     XDEF    _p%Get
  21. _p%Get
  22.     tst.l    _p%IOResult        ; is IO system OK?
  23.     bne    1$
  24.     tst.b    EOF(a0)            ; are we at EOF?
  25.     bne.s    1$            ; if so, leave
  26.     move.l    CURRENT(a0),a1        ; get the current ptr
  27.     adda.l    RECSIZE(a0),a1        ; add one record
  28.     move.l    a1,CURRENT(a0)        ; save the new ptr
  29.     cmpa.l    LAST(a0),a1        ; is it past end?
  30.     blt.s    1$            ; if not, skip the read
  31.     jsr    _p%FillBuffer        ; read a new buffer-full
  32. 1$    rts                ; return
  33.  
  34.     END
  35.